package com.cntcdt.api.db.model.base;

import java.io.Serializable;
import java.sql.ResultSet;
import java.util.Date;

/**
 * 这是cdt_shopping_comment的数据传输对象基类,直接与表对应<br>
 */
public abstract class ShoppingCommentModelBase  implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 属性:id<br>
     */
    private Integer id = 0;
    /**
     * 属性:content<br>
     */
    private String content = "";
    /**
     * 属性:shopImg<br>
     */
    private String shopImg = "";
    /**
     * 属性:userImg<br>
     */
    private String userImg = "";
    /**
     * 属性:position<br>
     */
    private String position = "";
    /**
     * 属性:shopName<br>
     */
    private String shopName = "";
    /**
     * 属性:addTime<br>
     */
    private Date addTime = new Date();
    /**
     * 属性:updateTime<br>
     */
    private Date updateTime = new Date();

    /**
     *  默认构造方法,构造一个默认的ShoppingCommentModelBase对象
     */
    public ShoppingCommentModelBase(){
    }

    /**
     *  构造函数
     *  @param rs 数据库查询结果集
     */
    public ShoppingCommentModelBase(ResultSet rs){
           try{
               this.id = rs.getInt("id");
               this.content = rs.getString("content");
               this.shopImg = rs.getString("shopImg");
               this.userImg = rs.getString("userImg");
               this.position = rs.getString("position");
               this.shopName = rs.getString("shopName");
               this.addTime = rs.getDate("addTime");
               this.updateTime = rs.getDate("updateTime");
           }catch(Exception e) {
              e.printStackTrace(); 
           }
    }


    /**
     * 设置属性id<br>
     * @param id 待设置的属性id的值
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取属性id<br>
     * @return 属性id的值
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置属性content<br>
     * @param content 待设置的属性content的值
     */
    public void setContent(String content) {
        this.content = content;
    }

    /**
     * 获取属性content<br>
     * @return 属性content的值
     */
    public String getContent() {
        return content;
    }

    /**
     * 设置属性shopImg<br>
     * @param shopImg 待设置的属性shopImg的值
     */
    public void setShopImg(String shopImg) {
        this.shopImg = shopImg;
    }

    /**
     * 获取属性shopImg<br>
     * @return 属性shopImg的值
     */
    public String getShopImg() {
        return shopImg;
    }

    /**
     * 设置属性userImg<br>
     * @param userImg 待设置的属性userImg的值
     */
    public void setUserImg(String userImg) {
        this.userImg = userImg;
    }

    /**
     * 获取属性userImg<br>
     * @return 属性userImg的值
     */
    public String getUserImg() {
        return userImg;
    }

    /**
     * 设置属性position<br>
     * @param position 待设置的属性position的值
     */
    public void setPosition(String position) {
        this.position = position;
    }

    /**
     * 获取属性position<br>
     * @return 属性position的值
     */
    public String getPosition() {
        return position;
    }

    /**
     * 设置属性shopName<br>
     * @param shopName 待设置的属性shopName的值
     */
    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    /**
     * 获取属性shopName<br>
     * @return 属性shopName的值
     */
    public String getShopName() {
        return shopName;
    }

    /**
     * 设置属性addTime<br>
     * @param addTime 待设置的属性addTime的值
     */
    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    /**
     * 获取属性addTime<br>
     * @return 属性addTime的值
     */
    public Date getAddTime() {
        return addTime;
    }

    /**
     * 设置属性updateTime<br>
     * @param updateTime 待设置的属性updateTime的值
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * 获取属性updateTime<br>
     * @return 属性updateTime的值
     */
    public Date getUpdateTime() {
        return updateTime;
    }


    /**
     * 比较两个对象在逻辑上是否相等
     * @see java.lang.Object#equals(java.lang.Object)
     */
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (!(other instanceof ShoppingCommentModelBase)) {
            return false;
        }

        final ShoppingCommentModelBase otherModel = (ShoppingCommentModelBase) other;
        if (getId()!=null && !getId().equals(otherModel.getId())) {
            return false;
        }
        return true;
    }

    /**
     * 根据主键生成HashCode
     * @see java.lang.Object#hashCode()
     */
    public int hashCode() {
        StringBuffer buffer = new StringBuffer();
        buffer.append('|').append(id);
        return buffer.toString().hashCode();
    }
}
